<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

namespace app\library\Points;

/**
 * Description of Base
 *
 * @author wangchanghong
 */

class Base {
    //错误消息
    public $errmsg = '';
    //是否为自己调用
    protected $isself = false;
    protected $pagesize = 20;

    protected function __construct() {
    }
    
    public static function getInstance(){
        static $obj = null;
        if(!$obj){
            $obj = new static;
        }
        
        return $obj;
    }
    
    /**
     * 设置错误消息
     * @param type $msg
     */
    function setErr($msg){
        $this->errmsg = $msg;
    }
    
    /**
     * 清除错误消息
     */
    function clearErr(){
        $this->errmsg = '';
    }
    
    function init(){
        $this->clearErr();
        $this->isself = false;
    }
}
